#!/usr/bin/env python
# -*- coding: utf-8 -*-

class Laptop(object):
    def __init__(self):
        self.__pinpai = 'Dell'

    def get_pinpai(self):
        return self.__pinpai

    def set_pinpai(self, pinpai):
        if isinstance(pinpai, str):
            self.__pinpai = pinpai
        else:
            raise TypeError('not a str object')

    @property
    def pinpai(self):
        return self.__pinpai

    @pinpai.setter
    def pinpai(self, pinpai):
        if isinstance(pinpai, str):
            self.__pinpai = pinpai
        else:
            raise TypeError('not a str object')


dell = Laptop()
print(dell.get_pinpai())      #Dell
# dell.set_pinpai(10)
dell.set_pinpai('Apple')
print(dell.get_pinpai())     #apple

print(dell.pinpai)    #apple
dell.pinpai = "Thinkpad"
print(dell.pinpai)     #Thinkpad
